package com.ssy.lingxi.product.api.feign;

import com.ssy.lingxi.common.model.vo.PageVO;
import com.ssy.lingxi.common.response.Wrapper;
import com.ssy.lingxi.product.api.hystrix.CustomerAttributeProductHystrix;
import com.ssy.lingxi.product.api.model.response.CustomerAttributeResponse;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @menu: 业务模块--属性管理
 * 业务模块-属性管理接口
 * @author jw.chen
 * @version 2.0.0
 * @date 2020/6/24
 */
@FeignClient(value = "product-service", fallback = CustomerAttributeProductHystrix.class)
public interface ICustomerAttributeProductFeign {

    /**
     * 查询属性树
     * @return Wrapper<?>
     */
    @RequestMapping(value = "/product/customer/getCustomerAttributeTree", method = RequestMethod.GET)
    Wrapper<?> getCustomerAttributeTree();

    /**
     * 查询属性信息
     * @param id
     * @return Wrapper<?>
     */
    @RequestMapping(value = "/product/customer/getCustomerAttribute", method = RequestMethod.GET)
    Wrapper<?> getCustomerAttribute(@RequestParam Long id);

    /**
     * 查询属性信息
     * @return Wrapper<?>
     */
    @RequestMapping(value = "/product/customer/getCustomerAttributeList", method = RequestMethod.GET)
    Wrapper<?> getCustomerAttributeList(PageVO pageVO, String name);

    /**
     * 新增/修改属性
     * @param customerAttributeVO
     * @return
     */
    @RequestMapping(value = "/product/customer/saveOrUpdateCustomerAttribute", method = RequestMethod.POST)
    Wrapper<?> saveOrUpdateCustomerAttribute(@RequestBody CustomerAttributeResponse customerAttributeVO);

    /**
     * 删除属性
     * @param id
     * @return
     */
    @RequestMapping(value = "/product/customer/deleteCustomerAttribute", method = RequestMethod.GET)
    Wrapper<?> deleteCustomerAttribute(@RequestParam Long id);

    /**
     * 启用/停用属性
     * @param id
     * @param status
     * @return
     */
    @RequestMapping(value = "/product/customer/updateCustomerAttributeStatus", method = RequestMethod.GET)
    Wrapper<?> updateCustomerAttributeStatus(@RequestParam Long id, @RequestParam Boolean status);

}
